Ethereum smart contracts for Catena blockchain explorer
npm install @catena/contract


Used to publish NRC public funding disclosures and on the Ethereum blockchain.
Built using the Truffle Framework.
Install:
npm install @catena/contract
Example usage:
``javascript
const { CatenaContract } = require('@catena/contract')
const catenaContract = CatenaContract(web3)
catenaContract.getDisclosure(687)
.then(result => console.log(result))
`
For more information on using a truffle contract see Truffle Docs.
- Install node dependencies: npm install
- Install an ethereum node: Parity or Geth
#### Parity
Parity works well but you must have the geth flag enabled or truffle migrations will fail.
parity --chain rinkeby --geth
Optionally, add the following for more convenient testing:
--unlock
--password#### Geth
If connecting to an actual testnet or mainnet network, you will first need time to sync
the blockchain. Running in --fast mode helps:
geth --fast --rpc --rpcapi eth,net,web3,personal --rpccorsdomain="*"Using mist:
./mist --syncmode=fast --cache=1024To test using rinkeby:
geth --rinkeby --fast --rpc --rpcapi eth,net,web3,personal --rpccorsdomain="*"Attaching to the geth node (assuming it's on localhost):
geth attach http://127.0.0.1:8545* geth commands
From the geth console you can look at the balance of your primary account:
eth.getBalance("0x0d9cf77f30e7af582762418d7011ef486a388275")Also, you can unlock your primary account to use its ether for testing or execution:
personal.unlockAccount("0x0d9cf77c30e7af582752418d7011ef486a388275", "password123", 0)$3
Testing the smart contract can be done as follows:
npm testThis will start a testrpc server and run truffle test.
To run a specific test:
npm test test/DisclosureManageTests.solIf you want to run tests on a different network like rinkeby, for example, use:
npm test --network rinkeby`