An EVM smart contract for posting global +jamed data.
Entries submitted to the contract contain:
$: author=@p
agent=@tas
action=@tas
data=* :: jammed data
==The accounts submitting entries
must own the ship in the author field.
You should only submit +jamed data.
The maximum allowed size of +jamed data is 1kb.
To do so from javascript, make use of the nockjs repo to build nouns and jam them.
example:
const noun = nockjs.Atom.fromCord('babay im goin on chain!')
const jammed = nockjs.jam(noun).bytes()
const tx = await contract.submitEntry(
aura.patp2dec('~migrev-dolseg'), // author
toBytes16('hawk'), // agent
toBytes16('some-action-name'), // action
new Uint8Array(jammed) // data
);
const reciept = await tx.wait();
see scripts/write.js for more.
the jamboard.hoon thread can be used in any desk which contains
- lib/ethereum.hoon
- lib/ethio.hoon
- lib/strandio.hoon
its input argument is:
+$ input
$: rpc-url=@t
author-filter=(unit @p)
agent-filter=(unit @tas)
action-filter=(unit @tas)
start-block=(unit @ud) :: otherwise, earliest
end-block=(unit @ud) :: otherwise, latest
==and its output is:
+$ output (list entry)
+$ entry
$: block-number=@ud
when=@da
author=@p
agent=@tas
action=@tas
data=*
==- open a terminal to the root of this repo
npm install- create a
.envfile with this RPC URL-
RPC_URL=http://127.0.0.1:8545
-
npx hardhat compilenpx hardhat node- starts local chain
- copy one of the fake account private keys to the
.envfile -
RPC_URL=http://127.0.0.1:8545 PRIVATE_KEY=0x...
- open a new terminal to the root of this repo
- deploy the contract
node scripts/deploy.js- copy the contract address to
.env -
RPC_URL=http://127.0.0.1:8545 PRIVATE_KEY=0x... CONTRACT_ADDRESS=0x...
- submit some fake data
node scripts/write.js --author="~migrev" --agent="hawk" --action="post-url" --data="some string here"
- use the reader thread to read from the contract
-jamboard 'http://localhost:8545' ~ ~ ~ ~ ~