Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Gitopia](https://img.shields.io/endpoint?style=&url=https://gitopia.org/mirror-badge.json)](https://gitopia.org/#/z_TqsbmVJOKzpuQH4YrYXv_Q0DrkwDwc0UqapRrE0Do/git-remote-gitopia)

git remote helper for [Gitopia](https://gitopia.org)
0.01 AR or 10% of the transaction fee, whichever is greater, will be charged as PST fee on git push. You don’t require an Arweave wallet for cloning repositories hence it’s free.
You don’t require an Arweave wallet for cloning repositories hence it’s free.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion bin/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { newProgressBar } from "./lib/util.js";
import * as deepHash from "arweave/node/lib/deepHash.js";
import ArweaveBundles from "arweave-bundles";

export const VERSION = "0.1.7";
export const VERSION = "0.1.8";

const _timeout = async (duration) => {
return new Promise((resolve, reject) => {
Expand Down
56 changes: 28 additions & 28 deletions bin/lib/arweave.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,34 @@ export const postBundledTransaction = async (
bar.stop();

// Send fee to PST holders
const contractState = await smartweave.default.readContract(
arweave,
contractId
);
const holder = smartweave.default.selectWeightedPstHolder(
contractState.balances
);
// const contractState = await smartweave.default.readContract(
// arweave,
// contractId
// );
// const holder = smartweave.default.selectWeightedPstHolder(
// contractState.balances
// );

// PST Fee
const txFee = new BigNumber(tx.reward);
const pstFee = txFee.multipliedBy(0.1);

const quantity = pstFee.isGreaterThan(
BigNumber(arweave.ar.arToWinston("0.01"))
)
? pstFee.toFixed(0)
: arweave.ar.arToWinston("0.01");

const pstTx = await arweave.createTransaction(
{ target: holder, quantity },
wallet
);
pstTx.addTag("Bundle-Txid", tx.id);
pstTx.addTag("Repo", repoName);
pstTx.addTag("Version", "0.0.2");
pstTx.addTag("App-Name", "Gitopia");
pstTx.addTag("Unix-Time", Math.round(new Date().getTime() / 1000).toString());

await arweave.transactions.sign(pstTx, wallet);
await arweave.transactions.post(pstTx);
// const txFee = new BigNumber(tx.reward);
// const pstFee = txFee.multipliedBy(0.1);

// const quantity = pstFee.isGreaterThan(
// BigNumber(arweave.ar.arToWinston("0.01"))
// )
// ? pstFee.toFixed(0)
// : arweave.ar.arToWinston("0.01");

// const pstTx = await arweave.createTransaction(
// { target: holder, quantity },
// wallet
// );
// pstTx.addTag("Bundle-Txid", tx.id);
// pstTx.addTag("Repo", repoName);
// pstTx.addTag("Version", "0.0.2");
// pstTx.addTag("App-Name", "Gitopia");
// pstTx.addTag("Unix-Time", Math.round(new Date().getTime() / 1000).toString());

// await arweave.transactions.sign(pstTx, wallet);
// await arweave.transactions.post(pstTx);
};
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitopia/git-remote-gitopia",
"version": "0.1.7",
"version": "0.1.8",
"description": "git-remote-helper for Gitopia",
"main": "bin/index.mjs",
"bin": {
Expand Down