Welcome!
Barnswallow is the codename for a sample blockchain explorer project to help developers get started with the js-swarm-sdk apis.
This project lists recent transactions from the staging environment of Swarm fund's invest platform. This project was created for the Swarm developer community to learn about the Swarm blockchain while creating an application that has value for the entire Swarm ecosytem.
Barnswallow is the start of a blockchain explorer and is not completed. Consider this project an open invitation to learn about blockchains in general and Swarm's blockchain specifically while adding features to this open project.
Barnswallow was created with React and Redux. The CSS for this project was inspired from https://stellarscan.io/
- swarm staging environment (link)
- js-swarm-sdk
- dependencies section
This project uses the js Swarm SDK which can be used from any application. To get started with the swarm-js-sdk from any project you can do the following
- Add js-swarm-sdk dependency with a package.json and run npm install as follows
File: package.json
"swarm-sdk": "git+ssh://git@github.com:swarmfund/js-swarm-sdk.git"
Commandline
> npm install
Alternatively you can do the following to install npm packages. Run the following commands after adding your ssh keys to the ssh-agent (since this is a remote repository see https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
> npm install -S git+ssh://git@github.com:swarmfund/js-swarm-sdk.git
- Create an instance of the sdk
import { Swarm } from 'swarm-sdk'`
let sdk = await Swarm.create('https://api-stage.swarm.fund')
- Explore js-swarm-sdk resources
- Create a Swarm wallet as follows,
To get started on your local development environment, use your wallet credentials as follows or substitute with an environment variable. For applications that are served on the web, prompt the user for these credentials,
let { wallet, recoverySeed } = await sdk.api.wallets.create(
'my@email.com',
'MyPassw0rd'
)
// Get the confirmation token from email and include as follows
await sdk.api.wallets.verifyEmail(token)
let wallet = await sdk.api.wallets.get('my@email.com', 'MyPassw0rd');
sdk.useWallet(wallet);
Contributions to the project are welcome and will benefit the entire Swarm Fund community. See CONTRIBUTING.md