Fix script to remove deployments
This commit is contained in:
parent
f739050d8c
commit
2b7d120887
@ -8,7 +8,8 @@ NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS=71Jvq4Epe2FCJ7JFSF7jLXdNk1Wy4Bhqd9iL6bEFEL
|
||||
# Multisig address
|
||||
NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS=FFDx3SdAEeXrp6BTmStB4BDHpctGsaasZq4FFcowRobY
|
||||
NEXT_PUBLIC_SOLANA_TOKEN_SYMBOL=GOR
|
||||
NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT=400000000 # Approx. 5 USD
|
||||
NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS=6
|
||||
NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT=400000000 # Approx. 5 USD
|
||||
|
||||
# UI Configuration
|
||||
NEXT_PUBLIC_EXAMPLE_URL=https://git.vdb.to/cerc-io/test-progressive-web-app
|
||||
|
||||
@ -36,7 +36,7 @@ Client-side (must be prefixed with NEXT_PUBLIC_):
|
||||
- `NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS` - The Solana address that will receive token payments
|
||||
- `NEXT_PUBLIC_SOLANA_TOKEN_SYMBOL` - The token symbol to display (e.g., "GOR")
|
||||
- `NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS` - The number of decimals for the token (e.g., 6)
|
||||
- `NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT` - The fixed payment amount required (e.g., 50)
|
||||
- `NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT` - The fixed payment amount required (e.g., 400)
|
||||
- `NEXT_PUBLIC_DOMAIN_SUFFIX` - Optional suffix to append to DNS names in the UI (e.g. ".example.com")
|
||||
- `NEXT_PUBLIC_EXAMPLE_URL` - Example URL to pre-fill in the URL form (e.g. "https://github.com/cerc-io/laconic-registry-cli")
|
||||
|
||||
@ -185,7 +185,7 @@ docker run -p 3000:3000 --env-file .env.production gor-deploy
|
||||
|
||||
- **Wrong token**: Verify the `NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS` matches your desired SPL token.
|
||||
- **Incorrect decimals**: Ensure `NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS` matches the token's actual decimal count.
|
||||
- **Payment amount**: Adjust `NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT` to the desired payment amount.
|
||||
- **Payment amount**: Adjust `NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT` to the desired payment amount.
|
||||
|
||||
### Laconic Registry Issues
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
# In gor-deploy/deploy dir
|
||||
docker run -it \
|
||||
-v ./:/app/deploy -w /app/deploy \
|
||||
-e DEPLOYMENT_REORD_ID=<deploment-record-id-to-be-removed> \
|
||||
-e DEPLOYMENT_RECORD_ID=<deploment-record-id-to-be-removed> \
|
||||
cerc/laconic-registry-cli:latest \
|
||||
./remove-deployment.sh
|
||||
```
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z $DEPLOYMENT_REORD_ID ]]; then
|
||||
if [[ -z $DEPLOYMENT_RECORD_ID ]]; then
|
||||
echo "Error: please pass the deployment record ID" >&2
|
||||
exit 1
|
||||
fi
|
||||
@ -10,7 +10,7 @@ fi
|
||||
source .registry.env
|
||||
echo "Using DEPLOYER_LRN: $DEPLOYER_LRN"
|
||||
|
||||
echo "Deployment record ID: $DEPLOYMENT_REORD_ID"
|
||||
echo "Deployment record ID: $DEPLOYMENT_RECORD_ID"
|
||||
|
||||
# Generate application-deployment-removal-request.yml
|
||||
REMOVAL_REQUEST_RECORD_FILE=./records/application-deployment-removal-request.yml
|
||||
|
||||
@ -161,7 +161,7 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
// Verify Solana payment
|
||||
console.log('Step 0: Verifying Solana token payment...');
|
||||
const paymentAmount = parseInt(process.env.NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT!);
|
||||
const paymentAmount = parseInt(process.env.NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT!);
|
||||
const tokenAmount = new BN(paymentAmount);
|
||||
const solanaPaymentResult = await verifyUnusedSolanaPayment(connection, txHash, tokenAmount);
|
||||
|
||||
|
||||
@ -25,13 +25,13 @@ export default function PaymentModal({
|
||||
const connection = useMemo(() => new Connection(SOLANA_RPC_URL), [])
|
||||
|
||||
// Get configuration from environment variables directly
|
||||
const amount = parseInt(process.env.NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT!);
|
||||
const amount = parseInt(process.env.NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT!);
|
||||
|
||||
const divisor = useMemo(() => {
|
||||
const decimalsEnv = process.env.NEXT_PUBLIC_MIN_SOLANA_TOKEN_DECIMALS;
|
||||
const decimalsEnv = process.env.NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS;
|
||||
const decimals = parseInt(decimalsEnv!, 10);
|
||||
if (isNaN(decimals)) {
|
||||
console.warn("Invalid NEXT_PUBLIC_MIN_SOLANA_TOKEN_DECIMALS; defaulting to 6.");
|
||||
console.warn("Invalid NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS; defaulting to 6.");
|
||||
return 1e6;
|
||||
}
|
||||
return 10 ** decimals;
|
||||
|
||||
@ -10,7 +10,7 @@ interface URLFormProps {
|
||||
export default function URLForm({ onSubmit, disabled }: URLFormProps) {
|
||||
// Get example URL from environment variables or use a default
|
||||
const exampleUrl = process.env.NEXT_PUBLIC_EXAMPLE_URL || 'https://example.com';
|
||||
const [url, setUrl] = useState(exampleUrl);
|
||||
const [url, setUrl] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user